package transfertest

import scala.io.StdIn

object Test01 {
  def main(args: Array[String]): Unit = {
    val n: Double = 1 + 2.0
    val n1: Byte = 1
    val n2: Char = 1
//    val n3: Byte = n1 + n2 计算的结果值类型为Int
//    val n4: Short = 10 + 90 计算的结果值类型为Int
    val n5: Short = 100 // 只判断范围
    val n6: Long = 100
    2.7.toInt
    val n7: Double = 1 + 1.0
    print("format=" + (10.0 / 3).formatted("%.2f"))
    10 % 3 // 1
    -10 % 3 // -1
    10 % -3 // 1
    -10 % -3 // -1
    val a = 2.0
    val b = 2.0f 
    print(a == b)
    val c = 2.3
    val d = 2.3f
    print(c == d)
    val e = 2.3
    val f = 2.3
    print(e == f)  // true
    StdIn.readLine()
  }
}

